<div class="right01"><img src="content/images/04.gif" /> <a href="<?php echo site_url(); ?>/C_Main/index/">主页</a> &gt; <span>用户信息</span> &gt; <span>操作用户权限</span></div>

<?php
$attributes = array('id' => 'submitform', 'method' => "POST", 'accept-charset' => "utf-8");
echo form_open('users/C_Users_Edit/role_User', $attributes);
?>
<?PHP if (is_array($entity) && is_array($users)) { ?>
    <div style="height: 30px;line-height: 2.2em; margin-left: 1.0em">当前操作用户名称：<?PHP echo $users[0]['u_name']; ?>
    </div>
    <div style="height: 30px; background-color: #f4f5eb; line-height: 2.2em;"><span style=" margin-left: 1.0em;font-weight: bold">权限选择</span>
    </div>
    <div class="divList">
        <ul>
            <li>
                订单信息<input id="customers" name="customers" type="checkbox" value="10001" 
                <?PHP
                $pos = strpos($entity[0]["ro_content"], "10001");
                if ($pos !== FALSE)
                    echo 'checked="checked"';
                else {
                    echo '';
                }
                ?>  />
            </li>
        </ul>
    </div>
    <div class="divList">
        <ul>
            <li>
                套系信息配置<input id="series" name="series" type="checkbox" value="10002" 
                <?PHP
                $pos = strpos($entity[0]["ro_content"], "10002");
                if ($pos !== FALSE)
                    echo 'checked="checked"';
                else {
                    echo '';
                }
                ?>    />
            </li>
        </ul>
    </div>
    <div class="divList">
        <ul>
            <li>
                基础内容配置<input id="product" name="product" type="checkbox" value="10003" 
                <?PHP
                $pos = strpos($entity[0]["ro_content"], "10003");
                if ($pos !== FALSE)
                    echo 'checked="checked"';
                else {
                    echo '';
                }
                ?>/>
            </li>
        </ul>
    </div>
    <div class="divList">
        <ul>
            <li>
                用户信息<input id="user" name="user" type="checkbox" value="10004" 
                <?PHP
                $pos = strpos($entity[0]["ro_content"], "10004");
                if ($pos !== FALSE)
                    echo 'checked="checked"';
                else {
                    echo '';
                }
                ?>/>
            </li>
        </ul>
    </div>
    <input name="u_id" type="hidden" value="<?PHP echo $users[0]['u_id']; ?>"/>
    <input id="ro_content" name="ro_content" type="hidden" value=""/>
    <?PHP
}
?>
<div style="margin-top: 20%; margin-left: 35%;">
    <input class="button" type="submit"  name="postsubmit" value="提交"/>
    <input class="button" type="button" name="resetbtn" onClick="resetButton()" value="返回"/>
</div>
<? echo form_close(); ?>
<script type="text/javascript">
    //提交插入信息时，获取表格全部信息
    $("#submitform").submit(function(){
        var resultStr="";
        $("input[type='checkbox']").each(function(){
            if($(this).attr("checked")){
                resultStr+=","+$(this).val();
            }
        });
        $("#ro_content").val(resultStr);
    });
    
    //返回
    function resetButton(){
        window.location.href="<?php echo site_url(); ?>/users/C_Users_List/";
    }
    
    function clickCheckBox(val)
    {
        obj =$("#"+val);
        if (obj.attr("checked")) {
            $("#"+val).attr("checked",false);
        }else{
            $("#"+val).attr("checked",true);
        }
    }
</script>